Skip to content

refactor: move encoding logic to aind-video-utils#35

Merged
galenlynch merged 1 commit into
mainfrom
refactor/remove-encoding-logic
Jun 26, 2026
Merged

refactor: move encoding logic to aind-video-utils#35
galenlynch merged 1 commit into
mainfrom
refactor/remove-encoding-logic

Conversation

@galenlynch

Copy link
Copy Markdown
Member

I have moved the aind-file-standards encoding presets into aind-video-utils, instead of having it baked into this ETL package. I think we should use aind-video-utils as the source of truth for encoding presets moving forward.

@galenlynch galenlynch requested a review from jtyoung84 March 2, 2026 04:32
@galenlynch galenlynch force-pushed the refactor/remove-encoding-logic branch from 409a16d to 691bdf5 Compare March 2, 2026 04:34
@galenlynch galenlynch force-pushed the refactor/remove-encoding-logic branch from 8638d09 to 1fa4f96 Compare May 20, 2026 16:24
@galenlynch

Copy link
Copy Markdown
Member Author

Coverage lowered because the PR eliminated lines of code, but did not change the test coverage.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors this ETL package to source ffmpeg encoding presets from aind-video-utils rather than maintaining hardcoded preset strings locally.

Changes:

  • Replaced in-repo ffmpeg preset enums/strings with a mapping to aind-video-utils EncodingProfiles and converted profiles into CLI arg strings.
  • Added aind-video-utils as a runtime dependency.
  • Lowered the coverage enforcement threshold in pyproject.toml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/aind_behavior_video_transformation/transform_videos.py Switches preset resolution to aind-video-utils encoding profiles and generates ffmpeg args from those profiles.
pyproject.toml Adds the new dependency and adjusts coverage gate settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/aind_behavior_video_transformation/transform_videos.py
Comment thread pyproject.toml
Comment thread src/aind_behavior_video_transformation/transform_videos.py
galenlynch added a commit that referenced this pull request May 20, 2026
Address Copilot review on #35:
- Key _COMPRESSION_PROFILES by the enum directly instead of stringly-typed
  member names so a future rename of CompressionEnum can't silently break
  preset lookup, and the DEFAULT alias is colocated with the rest of the
  map.
- Coerce None user_ffmpeg_{input,output}_options to "" when returning from
  the USER_DEFINED branch so determine_ffmpeg_arg_set actually honors its
  declared Tuple[str, str] return type. Empty strings are already treated
  as "no extra args" by convert_video, so behavior is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@jtyoung84 jtyoung84 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is removing classes, which is a breaking change and not just a refactor.

@galenlynch

Copy link
Copy Markdown
Member Author

I’ll change the commit messages to reflect that

BREAKING CHANGE: FfmpegInputArgs, FfmpegOutputArgs removed

ci: lower coverage threshold to 90

Removing the FfmpegInputArgs/FfmpegOutputArgs/FfmpegArgSet enums shrank
the statement denominator in transform_videos.py, dropping total
coverage from 92% to 91% even though no test behavior changed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

refactor: key compression profile dict by CompressionEnum

Address Copilot review on #35:
- Key _COMPRESSION_PROFILES by the enum directly instead of stringly-typed
  member names so a future rename of CompressionEnum can't silently break
  preset lookup, and the DEFAULT alias is colocated with the rest of the
  map.
- Coerce None user_ffmpeg_{input,output}_options to "" when returning from
  the USER_DEFINED branch so determine_ffmpeg_arg_set actually honors its
  declared Tuple[str, str] return type. Empty strings are already treated
  as "no extra args" by convert_video, so behavior is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

chore: bump aind-video-utils dep
@galenlynch galenlynch force-pushed the refactor/remove-encoding-logic branch from ee23a48 to 0d0c9fa Compare June 26, 2026 21:05
@galenlynch galenlynch merged commit 06631ea into main Jun 26, 2026
4 checks passed
@galenlynch galenlynch deleted the refactor/remove-encoding-logic branch June 26, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants